this.iconName = iconName;
this.isChat = false;
- this.isMuted = false;
this.notifications = [];
this.emit('title-changed');
},
- setMuted: function(muted) {
- if (!this.isChat || this.isMuted == muted)
- return;
- this.isMuted = muted;
- this.emit('muted-changed');
- },
-
// Called to create a new icon actor.
// Provides a sane default implementation, override if you need
// something more fancy.
notification.acknowledged = false;
this.pushNotification(notification);
- if (!this.isMuted) {
- // Play the sound now, if banners are disabled.
- // Otherwise, it will be played when the notification
- // is next shown.
- if (this.policy.showBanners) {
- this.emit('notify', notification);
- } else {
- notification.playSound();
- }
+ if (this.policy.showBanners) {
+ this.emit('notify', notification);
+ } else {
+ notification.playSound();
}
},
source: source,
notifyId: 0,
destroyId: 0,
- mutedChangedId: 0
};
if (source.isClearable)
obj.notifyId = source.connect('notify', Lang.bind(this, this._onNotify));
obj.destroyId = source.connect('destroy', Lang.bind(this, this._onSourceDestroy));
- obj.mutedChangedId = source.connect('muted-changed', Lang.bind(this,
- function () {
- if (source.isMuted)
- this._notificationQueue = this._notificationQueue.filter(function(notification) {
- return source != notification.source;
- });
- }));
this.emit('source-added', source);
source.disconnect(obj.notifyId);
source.disconnect(obj.destroyId);
- source.disconnect(obj.mutedChangedId);
this.emit('source-removed', source);